<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Model;

class Article extends Model
{
    use DataTables;

    //
    public $table = 'article';

    protected $fillable = ['cate_id','title','description','content','author','from'];

    /**
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
     *  获取对应文章类型
     */
    public function category()
    {

        return $this->belongsTo(ArticleCategory::class, 'cate_id', 'id');
    }

    /**
     *  转载函数
     */
    public function loadSave($data, $update_id)
    {

    }

}
